package com.tuanzi.loan.web.bean;

import java.util.List;

import javax.annotation.PostConstruct;
import javax.faces.bean.ViewScoped;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.google.common.collect.Lists;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.web.configuration.JSFBean;
import com.tuanzi.loan.workflow.service.WorkflowProcessorService;
import com.tuanzi.loan.workflow.vo.TaskResponse;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author Ray 2018/01/22
 */
@Data
@Debug
@Component
@ViewScoped
@EqualsAndHashCode(callSuper = true)
public class WorkflowContentBean extends JSFBean {

	private static final long serialVersionUID = 3019835637214096291L;

	@Autowired
	private WorkflowProcessorService workflowProcessorService;

	private TaskResponse taskResponse;
	private List<String> urls = Lists.newArrayList("www.baidu.com", "www.google.com");
	private String url = "/views/system/dictionary/dictionary-info.xhtml";

	@PostConstruct
	private void init() {
		String id = getParamFromRequest("id");
		taskResponse = workflowProcessorService.findTask(id);
		urls = Lists.newArrayList("www.baidu.com", "www.google.com");
	}

	public void onSubmit() {

	}

	public void onSave() {
		System.out.println("asd");
	}
}
